﻿Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Navigation

Partial Public Class HomePage
    Inherits Page

    Public Sub New()
        Me.InitializeComponent()
        'Me.DataContext = viewmodel
        Me.DataContext = New HomePageViewModel()
    End Sub

    'Executes when the user navigates to this page.
    Protected Overrides Sub OnNavigatedTo(ByVal e As NavigationEventArgs)
        '如果用户未登录，则跳转到登录页面
        If Application.Current.Resources("UserId") Is Nothing Then
            NavigationService.Navigate(NavigationData.LOGIN_PAGE_URI)
        End If
    End Sub

End Class
